package chapter12_1.aop;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
// 切面类
public class MyAspect implements MethodInterceptor {
    @Override
    public Object invoke(MethodInvocation mi) throws Throwable {
        // 执行目标方法
        Object obj = mi.proceed();
        log();
        return obj;
    }
    public void log(){
        System.out.println("记录日志......");
    }
}
